package com.easychat.constants;

import com.easychat.entity.enums.UserTypeEnum;

public class Constants {
    //验证码结果对应的key
    public static final String REDIS_KEY_CHECK_CODE = "easychat:checkcode:";//树形结构
    //websocket心跳对应的key
    public static final String REDIS_KEY_WS_USER_HEART_BEAT = "easychat:ws:user:heartbeat:";
    //TokenUserInfoDTO对应的key
    public static final String REDIS_KEY_WS_TOKEN = "easychat:ws:token:";
    public static final String REDIS_KEY_WS_TOKEN_USERID = "easychat:ws:token:userid:";
    //系统设置对象SysSettingDTO对应的key
    public static final String REDIS_KEY_SYS_SETTING = "easychat:syssetting:";
    //用户联系人列表对应的key
    public static final String REDIS_KEY_USER_CONTACT= "easychat:ws:user:contact:";
    //三天对应的毫秒数
    public static final Long MILLIS_3DAYS = 3 * 24 * 60 * 60 * 1000L;
    //心跳过期时间
    public static final Integer REDIS_KEY_EXPIRES_HEART_BEAT = 6;
    //用于设置过期时间
    public static final Integer REDIS_TIME_1MIN = 60;
    public static final Integer REDIS_TIME_1DAY = REDIS_TIME_1MIN * 60 * 24;
    //用于生成用户ID，设置长度
    public static final Integer LENGTH_11 = 11;
    //用于生成token
    public static final Integer LENGTH_20 = 20;
    //机器人UID
    public static final String ROBOT_UID = UserTypeEnum.USER.getPrefix() + "robot";
    //文件存储根目录
    public static final String FILE_FOLDER_FILE = "file/";
    //头像存储
    public static final String FILE_FOLDER_AVATAR = "avatar/";
    //图片扩展名(原图)
    public static final String IMAGE_EXTENSION = ".png";
    //图片扩展名(缩略图)
    public static final String COVER_IMAGE_EXTENSION = "_cover.png";
    //更新文件目录
    public static final String APP_UPDATE_FOLDER = "app/";
    //更新文件后缀
    public static final String APP_UPDATE_EXTENSION = ".exe";
    //更新文件名称
    public static final String APP_NAME = "EasyChatUpdate.";
    //默认申请信息模板
    public static final String APPLY_INFO_TEMPLATE = "我是%s";
    //密码正则表达式
    public static final String REGEX_PASSWORD = "^(?=.*\\d)(?=.*[a-zA-Z])[\\da-zA-Z~!@#$%^&*_]{8,18}$";
    //所有可能的图片扩展名
    public static final String[] IMAGE_EXTENSION_LIST = new String[]{".gif", ".png", ".jpeg", ".jpg", ".bmp", ".webp"};
    //所有可能的视频扩展名
    public static final String[] VIDEO_EXTENSION_LIST = new String[]{".mp4", ".avi", ".rmvb", ".mkv", ".mov"};
    //用于单位换算，1MB = 1024*1024B（字节）
    public static final Long FILE_SIZE_MB = 1024 * 1024L;
    //DIRECT模式的交换机名称
    public static final String EXCHANGE_DIRECT = "exchange.direct.msgHandler";
    //对于集群部署的每一台服务器，都由其各自不同的路由key，绑定到不同的队列
    public static final String ROUTING_KEY = "key.";
    //根据端口号区分不同服务器对应的队列
    public static final String QUEUE_NAME = "queue.";
    //k: 用户ID v: 服务器的端口号
    public static final String REDIS_KEY_UID2PORT = "easychat:uid2port:";
}
